<template>
<div>
  <div v-show="flag&&flag2&&flag1">
    <div style="text-align:left;">
        <el-form :inline="true" class="demo-form-inline">
            <el-form-item label="按需查询">
              <el-input placeholder="会员姓名" v-model="memName" clearable></el-input>
            </el-form-item>
            <el-form-item label="">
              <el-input placeholder="手机号" v-model="memPhone" clearable></el-input>
            </el-form-item>
            <el-form-item label="">
              <el-input placeholder="年龄" type="number" v-model="memAge"></el-input>
            </el-form-item>
            <el-form-item>
                <el-button type="primary" icon="el-icon-search" @click="search">查询</el-button>
                <el-button type="success" icon="el-icon-brush" @click="clearCondition">清空条件</el-button>
            </el-form-item>
            <el-button type="primary" round style="float: right" @click="flag=false"><i class="el-icon-circle-plus-outline"></i> 添加会员</el-button>
        </el-form>
    </div>
    <el-table :data="tableData" border style="width: 100%">
        <el-table-column fixed prop="memName" label="姓名" width="140"></el-table-column>
        <el-table-column prop="memGender" label="性别" width="100"></el-table-column>
        <el-table-column prop="memAge" label="年龄" width="100"></el-table-column>
        <el-table-column prop="memNation" label="民族" width="100"></el-table-column>
        <el-table-column prop="memPhone" label="手机号码" width="180"></el-table-column>
        <el-table-column prop="memCreateDate" label="注册时间" width="200"></el-table-column>
        <el-table-column prop="memState" label="会员状态" width="120" :formatter="formatState"></el-table-column>
        <el-table-column fixed="right" label="操作" width="303" fit='true'>
            <template slot-scope="scope">
              <el-button type="text" @click="watchMem(scope.row)"><i class="el-icon-zoom-in"></i>查看详情</el-button>
              <el-button type="text" @click="clickUpMember(scope.row)"><i class="el-icon-edit"></i>编辑</el-button>
              <el-button type="text" v-show="scope.row.memState==0" @click="upMemState1(scope.row.memId,1)"><i class="el-icon-error"></i>禁用</el-button>
              <el-button type="text" v-show="scope.row.memState==1" @click="upMemState0(scope.row.memId,0)"><i class="el-icon-success"></i>启用</el-button>
              <el-button type="text" @click="addChatList(scope.row)" title="加入咨询列表"><i class="el-icon-chat-dot-round"></i>开启聊天</el-button>
            </template>
        </el-table-column>
    </el-table>
    <el-pagination
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
            :current-page="currentPage"
            :page-sizes="[3, 5, 9, 15]"
            :page-size="pageSize"
            layout="total, sizes, prev, pager, next, jumper"
            :total="total">
    </el-pagination>
  </div>

  <!-- 新增div -->
  <div v-show="!flag">
    <h1>新增会员</h1>
    <el-tabs type="border-card">
      <el-tab-pane label="基本信息">
        <div style="width:35%;display:inline-block;">
          <el-form label-position="right" :rules="rules" ref="addMember1" label-width="90px" :model="addMember">
            <el-form-item label="姓名" style="margin-top:29px" prop="memName">
              <el-input v-model="addMember.memName"></el-input>
            </el-form-item>
            <el-form-item label="手机号" style="margin-top:29px" prop="memPhone">
              <el-input v-model="addMember.memPhone"></el-input>
            </el-form-item>
            <el-form-item label="籍贯" style="margin-top:29px" prop="memNativePlace">
              <el-input v-model="addMember.memNativePlace"></el-input>
            </el-form-item>
            <el-form-item label="邮箱" style="margin-top:29px">
              <el-input v-model="addMember.memEmail"></el-input>
            </el-form-item>
            <el-form-item label="职业" style="margin-top:29px">
              <el-input v-model="addMember.memKarin"></el-input>
            </el-form-item>
          </el-form>
        </div>
        <div style="width:35%;display:inline-block">
          <el-form label-position="right" :rules="rules" ref="addMember2" label-width="90px" :model="addMember">
            <el-form-item label="身份证" style="margin-top:29px" prop="memIdentity">
              <el-input v-model="addMember.memIdentity"></el-input>
            </el-form-item>
            <el-form-item label="性别" style="margin-top:29px;text-align:left">
              <!-- <el-input v-model="addMember.memGender"></el-input> -->
              <el-select v-model="addMember.memGender" placeholder="请选择性别">
                <el-option label="男" value="男"></el-option>
                <el-option label="女" value="女"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="民族" style="margin-top:29px">
              <el-input v-model="addMember.memNation"></el-input>
            </el-form-item>
            <el-form-item label="婚姻状况" style="margin-top:29px">
              <el-input v-model="addMember.memWedlock"></el-input>
            </el-form-item>
            <el-form-item label="文化程度" style="margin-top:29px">
              <el-input v-model="addMember.memDegree"></el-input>
            </el-form-item>
          </el-form>
        </div>
        <div style="width:70%;display:inline-block">
          <el-form label-width="90px" v-model="addMember">
            <el-form-item label="个人说明" style="margin-top:29px">
              <el-input type="textarea" v-model="addMember.memDesc"></el-input>
            </el-form-item>
          </el-form>
        </div>

      </el-tab-pane>
      <el-tab-pane label="动态信息">

        <div style="width:35%;display:inline-block;">
          <el-form label-position="right" label-width="120px" :model="addMemTrend">
            <el-form-item label="身高(cm)" style="margin-top:29px">
              <el-input v-model="addMemTrend.memTreHeight"></el-input>
            </el-form-item>
            <el-form-item label="舒张压(mmHg)" style="margin-top:29px">
              <el-input v-model="addMemTrend.memTreDiastole"></el-input>
            </el-form-item>
            <el-form-item label="体温(℃)" style="margin-top:29px">
              <el-input v-model="addMemTrend.memTreTemperature"></el-input>
            </el-form-item>
            <el-form-item label="腰围(cm)" style="margin-top:29px">
              <el-input v-model="addMemTrend.memTreWaistline"></el-input>
            </el-form-item>
            <el-form-item label="BMI" style="margin-top:29px">
              <el-input v-model="addMemTrend.memTreBmi"></el-input>
            </el-form-item>
          </el-form>
        </div>
        <div style="width:35%;display:inline-block">
          <el-form label-position="right" label-width="130px" :model="addMemTrend">
            <el-form-item label="体重(kg)" style="margin-top:29px">
              <el-input v-model="addMemTrend.memTreWeight"></el-input>
            </el-form-item>
            <el-form-item label="收缩压(mmHg)" style="margin-top:29px">
              <el-input v-model="addMemTrend.memTreShrink"></el-input>
            </el-form-item>
            <el-form-item label="呼吸频率(次/分钟)" style="margin-top:29px">
              <el-input v-model="addMemTrend.memTreBreathe"></el-input>
            </el-form-item>
            <el-form-item label="臀围(cm)" style="margin-top:29px">
              <el-input v-model="addMemTrend.memTreHip"></el-input>
            </el-form-item>
            <el-form-item label="血氧饱和度" style="margin-top:29px">
              <el-input v-model="addMemTrend.memTreOxygen"></el-input>
            </el-form-item>
          </el-form>
        </div>

      </el-tab-pane>
      <el-tab-pane label="病史信息">
        <el-form label-width="80px" v-model="addHistory">
          <el-form-item label="家族史" style="margin-top:29px">
            <el-input type="textarea" v-model="addHistory.memCaseHisClan"></el-input>
          </el-form-item>
          <el-form-item label="手术史" style="margin-top:29px">
            <el-input type="textarea" v-model="addHistory.memCaseHisOperation"></el-input>
          </el-form-item>
          <el-form-item label="过敏史" style="margin-top:29px">
            <el-input type="textarea" v-model="addHistory.memCaseHisAllergy"></el-input>
          </el-form-item>
          <el-form-item label="病史" style="margin-top:29px">
            <el-input type="textarea" v-model="addHistory.memCaseHisMedical"></el-input>
          </el-form-item>
          <el-form-item label="慢性病" style="margin:29px 0">
            <el-input type="textarea" v-model="addHistory.memCaseHisChronic"></el-input>
          </el-form-item>
        </el-form>
      </el-tab-pane>
    </el-tabs>
    <div style="margin:30px 0">
       <el-button type="success" @click="flag=true">返回列表</el-button>
       <el-button type="primary" @click="submitAdd">立即创建会员</el-button>
       <el-button @click="clearAdd">重置所有内容</el-button>
    </div>
  </div>

  <!-- 修改div -->
  <div v-show="!flag1">
    <h1>修改会员信息</h1>
    <el-tabs type="border-card">
      <el-tab-pane label="基本信息">
        <div style="width:35%;display:inline-block;">
          <el-form label-position="right" :rules="rules" ref="upMember1" label-width="90px" :model="upMember">
            <el-form-item label="姓名" style="margin-top:29px" prop="memName">
              <el-input v-model="upMember.memName"></el-input>
            </el-form-item>
            <el-form-item label="手机号" style="margin-top:29px" prop="memPhone">
              <el-input v-model="upMember.memPhone"></el-input>
            </el-form-item>
            <el-form-item label="籍贯" style="margin-top:29px" prop="memNativePlace">
              <el-input v-model="upMember.memNativePlace"></el-input>
            </el-form-item>
            <el-form-item label="邮箱" style="margin-top:29px">
              <el-input v-model="upMember.memEmail"></el-input>
            </el-form-item>
            <el-form-item label="职业" style="margin-top:29px">
              <el-input v-model="upMember.memKarin"></el-input>
            </el-form-item>
          </el-form>
        </div>
        <div style="width:35%;display:inline-block">
          <el-form label-position="right" :rules="rules" ref="upMember2" label-width="90px" :model="upMember">
            <el-form-item label="身份证" style="margin-top:29px" prop="memIdentity">
              <el-input v-model="upMember.memIdentity"></el-input>
            </el-form-item>
            <el-form-item label="性别" style="margin-top:29px;text-align:left">
              <el-select v-model="upMember.memGender" placeholder="请选择性别">
                <el-option label="男" value="男"></el-option>
                <el-option label="女" value="女"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="民族" style="margin-top:29px">
              <el-input v-model="upMember.memNation"></el-input>
            </el-form-item>
            <el-form-item label="婚姻状况" style="margin-top:29px">
              <el-input v-model="upMember.memWedlock"></el-input>
            </el-form-item>
            <el-form-item label="文化程度" style="margin-top:29px">
              <el-input v-model="upMember.memDegree"></el-input>
            </el-form-item>
          </el-form>
        </div>
        <div style="width:70%;display:inline-block">
          <el-form label-width="90px" v-model="upMember">
            <el-form-item label="个人说明" style="margin-top:29px">
              <el-input type="textarea" v-model="upMember.memDesc"></el-input>
            </el-form-item>
          </el-form>
        </div>

      </el-tab-pane>
      <el-tab-pane label="动态信息">

        <div style="width:35%;display:inline-block;">
          <el-form label-position="right" label-width="120px" :model="upMemTrend">
            <el-form-item label="身高(cm)" style="margin-top:29px">
              <el-input v-model="upMemTrend.memTreHeight"></el-input>
            </el-form-item>
            <el-form-item label="舒张压(mmHg)" style="margin-top:29px">
              <el-input v-model="upMemTrend.memTreDiastole"></el-input>
            </el-form-item>
            <el-form-item label="体温(℃)" style="margin-top:29px">
              <el-input v-model="upMemTrend.memTreTemperature"></el-input>
            </el-form-item>
            <el-form-item label="腰围(cm)" style="margin-top:29px">
              <el-input v-model="upMemTrend.memTreWaistline"></el-input>
            </el-form-item>
            <el-form-item label="BMI" style="margin-top:29px">
              <el-input v-model="upMemTrend.memTreBmi"></el-input>
            </el-form-item>
          </el-form>
        </div>
        <div style="width:35%;display:inline-block">
          <el-form label-position="right" label-width="130px" :model="upMemTrend">
            <el-form-item label="体重(kg)" style="margin-top:29px">
              <el-input v-model="upMemTrend.memTreWeight"></el-input>
            </el-form-item>
            <el-form-item label="收缩压(mmHg)" style="margin-top:29px">
              <el-input v-model="upMemTrend.memTreShrink"></el-input>
            </el-form-item>
            <el-form-item label="呼吸频率(次/分钟)" style="margin-top:29px">
              <el-input v-model="upMemTrend.memTreBreathe"></el-input>
            </el-form-item>
            <el-form-item label="臀围(cm)" style="margin-top:29px">
              <el-input v-model="upMemTrend.memTreHip"></el-input>
            </el-form-item>
            <el-form-item label="血氧饱和度" style="margin-top:29px">
              <el-input v-model="upMemTrend.memTreOxygen"></el-input>
            </el-form-item>
          </el-form>
        </div>

      </el-tab-pane>
      <el-tab-pane label="病史信息">
        <el-form label-width="80px" v-model="upHistory">
          <el-form-item label="家族史" style="margin-top:29px">
            <el-input type="textarea" v-model="upHistory.memCaseHisClan"></el-input>
          </el-form-item>
          <el-form-item label="手术史" style="margin-top:29px">
            <el-input type="textarea" v-model="upHistory.memCaseHisOperation"></el-input>
          </el-form-item>
          <el-form-item label="过敏史" style="margin-top:29px">
            <el-input type="textarea" v-model="upHistory.memCaseHisAllergy"></el-input>
          </el-form-item>
          <el-form-item label="病史" style="margin-top:29px">
            <el-input type="textarea" v-model="upHistory.memCaseHisMedical"></el-input>
          </el-form-item>
          <el-form-item label="慢性病" style="margin:29px 0">
            <el-input type="textarea" v-model="upHistory.memCaseHisChronic"></el-input>
          </el-form-item>
        </el-form>
      </el-tab-pane>
    </el-tabs>
    <div style="margin:30px 0">
       <el-button type="success" @click="flag1=true">返回列表</el-button>
       <el-button type="primary" @click="submitUp">保存修改</el-button>
    </div>
  </div>

  <!-- 查看详情div -->
  <div v-show="!flag2">
    <h1>查看会员信息</h1>
    <el-descriptions title="会员基本信息" border>
       <template slot="extra">
        <el-button type="success" @click="flag2=true">返回列表</el-button>
      </template>
      <el-descriptions-item label="姓名">{{watchMember.memName}}</el-descriptions-item>
      <el-descriptions-item label="身份证号">{{watchMember.memIdentity}}</el-descriptions-item>
      <el-descriptions-item label="手机号">{{watchMember.memPhone}}</el-descriptions-item>
      <el-descriptions-item label="性别">{{watchMember.memGender}}</el-descriptions-item>
      <el-descriptions-item label="年龄">{{watchMember.memAge}}</el-descriptions-item>
      <el-descriptions-item label="籍贯">{{watchMember.memNativePlace}}</el-descriptions-item>
      <el-descriptions-item label="民族">{{watchMember.memNation}}</el-descriptions-item>
      <el-descriptions-item label="出生日期">{{watchMember.memBirthday}}</el-descriptions-item>
      <el-descriptions-item label="邮箱">{{watchMember.memEmail}}</el-descriptions-item>
      <el-descriptions-item label="婚姻状态">{{watchMember.memWedlock}}</el-descriptions-item>
      <el-descriptions-item label="职业">{{watchMember.memKarin}}</el-descriptions-item>
      <el-descriptions-item label="文化程度">{{watchMember.memDegree}}</el-descriptions-item>
      <el-descriptions-item label="个人说明">{{watchMember.memDesc}}</el-descriptions-item>
    </el-descriptions>
    <el-descriptions title="会员动态信息" :column="5" border style="margin: 30px 0">
      <el-descriptions-item label="身高(cm)">{{watchMemTrend.memTreHeight}}</el-descriptions-item>
      <el-descriptions-item label="体重(kg)">{{watchMemTrend.memTreWeight}}</el-descriptions-item>
      <el-descriptions-item label="舒张压(mmHg)">{{watchMemTrend.memTreDiastole}}</el-descriptions-item>
      <el-descriptions-item label="收缩压(mmHg)">{{watchMemTrend.memTreShrink}}</el-descriptions-item>
      <el-descriptions-item label="体温(℃)">{{watchMemTrend.memTreTemperature}}</el-descriptions-item>
      <el-descriptions-item label="呼吸频率(次/分钟)">{{watchMemTrend.memTreBreathe}}</el-descriptions-item>
      <el-descriptions-item label="腰围(cm)">{{watchMemTrend.memTreWaistline}}</el-descriptions-item>
      <el-descriptions-item label="臀围(cm)">{{watchMemTrend.memTreHip}}</el-descriptions-item>
      <el-descriptions-item label="BMI(体重指数)">{{watchMemTrend.memTreBmi}}</el-descriptions-item>
      <el-descriptions-item label="血氧饱和度">{{watchMemTrend.memTreOxygen}}</el-descriptions-item>
    </el-descriptions>
    <el-descriptions title="会员病史信息" :column="1">
      <el-descriptions-item label="家族史">{{watchHistory.memCaseHisClan}}</el-descriptions-item>
      <el-descriptions-item label="手术史">{{watchHistory.memCaseHisOperation}}</el-descriptions-item>
      <el-descriptions-item label="过敏史">{{watchHistory.memCaseHisAllergy}}</el-descriptions-item>
      <el-descriptions-item label="病史">{{watchHistory.memCaseHisMedical}}</el-descriptions-item>
      <el-descriptions-item label="慢性病">{{watchHistory.memCaseHisChronic}}</el-descriptions-item>
    </el-descriptions>
  </div>

</div>
</template>

<script>
export default {
  name: 'Record',
  data () {
    return {
      tableData: [],
      total: 0,
      currentPage: 1,
      pageSize: 5,
      memName: '',
      memPhone: '',
      memAge: '',
      flag: true,
      flag1: true,
      flag2: true,
      addMember: {memGender: '男'},
      addMemTrend: {},
      addHistory: {},
      yanzheng: '',
      upMember: {},
      upMemTrend: {},
      upHistory: {},
      watchMember: {},
      watchMemTrend: {},
      watchHistory: {},
      rules: {
        memName: [
          { required: true, message: '请输入姓名', trigger: 'blur' }
        ],
        memPhone: [
          { required: true, message: '请输入手机号', trigger: 'blur' },
          { min: 11, max: 11, message: '手机号格式错误', trigger: 'blur' }
        ],
        memNativePlace: [
          { required: true, message: '请输入籍贯', trigger: 'blur' }
        ],
        memIdentity: [
          { required: true, message: '请输入身份证', trigger: 'blur' },
          { min: 18, max: 18, message: '身份证格式错误', trigger: 'blur' }
        ]
      }
    }
  },
  methods: {
    // 加载菜单和角色的方法
    initMember () {
      this.$axios.post(`/api/DHMemberController/initMember?pageNum=${this.currentPage}&pageSize=${this.pageSize}&memName=${this.memName}&memPhone=${this.memPhone}&memAge=${this.memAge}`).then(({data}) => {
        this.tableData = data.rows
        this.total = data.total
      })
    },
    // 格式化状态
    formatState (row, column, cellValue, index) {
      return row.memState === 0 ? '正常' : row.memState === 1 ? '禁用' : '未知'
    },
    // 改变页大小
    handleSizeChange (value) {
      this.pageSize = value
      this.initMember()
    },
    // 改变当前页码
    handleCurrentChange (value) {
      this.currentPage = value
      this.initMember()
    },
    // 清空条件
    clearCondition () {
      this.memName = ''
      this.memPhone = ''
      this.memAge = ''
    },
    // 查询按钮
    search () {
      this.currentPage = 1
      this.initMember()
    },
    // 启用禁用的方法
    upMemState1 (memId, memState) {
      this.$confirm('确定要冻结该会员吗？, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.$axios.put(`/api/DHMemberController/upMemState?memId=${memId}&memState=${memState}`).then(result => {
          this.$message({
            type: 'success',
            message: '冻结成功!'
          })
          this.initMember()
        })
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消冻结'
        })
      })
    },
    upMemState0 (memId, memState) {
      this.$confirm('确定要重新启用该会员吗？, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.$axios.put(`/api/DHMemberController/upMemState?memId=${memId}&memState=${memState}`).then(result => {
          this.$message({
            type: 'success',
            message: '启用成功!'
          })
          this.initMember()
        })
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消重新启用'
        })
      })
    },
    // 查看详情
    watchMem (row) {
      this.flag2 = false
      this.$axios.post(`/api/DHMemberController/queryByMemIdMember?memId=${row.memId}`).then(({data}) => {
        this.watchMember = data
      })
      this.$axios.post(`/api/DHMemberController/queryByMemIdTrends?memId=${row.memId}`).then(({data}) => {
        this.watchMemTrend = data
      })
      this.$axios.post(`/api/DHMemberController/queryByMemIdCaseHistory?memId=${row.memId}`).then(({data}) => {
        this.watchHistory = data
      })
    },
    // 点击修改
    clickUpMember (row) {
      this.flag1 = false
      this.$axios.post(`/api/DHMemberController/queryByMemIdMember?memId=${row.memId}`).then(({data}) => {
        this.upMember = data
      })
      this.$axios.post(`/api/DHMemberController/queryByMemIdTrends?memId=${row.memId}`).then(({data}) => {
        this.upMemTrend = data
      })
      this.$axios.post(`/api/DHMemberController/queryByMemIdCaseHistory?memId=${row.memId}`).then(({data}) => {
        this.upHistory = data
      })
    },
    // 提交添加的方法
    submitAdd () {
      let flag1 = false
      let flag2 = false
      this.$refs['addMember1'].validate((valid) => {
        if (valid) {
          flag1 = true
        } else {
          flag1 = false
        }
      })
      this.$refs['addMember2'].validate((valid) => {
        if (valid) {
          flag2 = true
        } else {
          flag2 = false
        }
      })
      if (flag1 === true && flag2 === true) {
        this.$confirm('确认创建该会员吗, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          this.addMember.trends = this.addMemTrend
          this.addMember.caseHistory = this.addHistory
          this.$axios.post(`/api/DHMemberController/addMember`, this.addMember).then(result => {
            this.addMember = {memGender: '男'}
            this.addMemTrend = {}
            this.addHistory = {}
            this.$message({
              type: 'success',
              message: '会员添加成功!'
            })
            this.flag = true
            this.initMember()
          })
        }).catch(() => {
          this.$message('已取消添加')
        })
      }
    },
    // 提交修改的方法
    submitUp () {
      let flag1 = false
      let flag2 = false
      this.$refs['upMember1'].validate((valid) => {
        if (valid) {
          flag1 = true
        } else {
          flag1 = false
        }
      })
      this.$refs['upMember2'].validate((valid) => {
        if (valid) {
          flag2 = true
        } else {
          flag2 = false
        }
      })
      if (flag1 === true && flag2 === true) {
        this.$confirm('确认修改该会员信息吗, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          this.upMember.trends = this.upMemTrend
          this.upMember.caseHistory = this.upHistory
          this.$axios.put(`/api/DHMemberController/upMember`, this.upMember).then(result => {
            this.$message({
              type: 'success',
              message: '会员信息修改成功!'
            })
            this.flag1 = true
            this.initMember()
          })
        }).catch(() => {
          this.$message('已取消修改')
        })
      }
    },
    // 添加到咨询列表
    addChatList (row) {
      let user = JSON.parse(sessionStorage.getItem('user'))
      this.$axios.post(`/api/DHChatTableController/queryByHmIdAndMemId?hmId=${user.hmId}&memId=${row.memId}`).then(({data}) => {
        if (data != null && data !== '') {
          this.$message({
            message: '该会员已经在你的咨询列表中，请到咨询列表查看',
            type: 'warning'
          })
        } else {
          let chat = {
            hmId: user.hmId,
            memId: row.memId
          }
          this.$axios.post(`/api/DHChatTableController/addChatList`, chat).then(result => {
            this.$message({
              type: 'success',
              message: '添加咨询列表成功!请前往咨询列表进行相关操作'
            })
          })
        }
      })
    },
    // 清空添加表单的方法
    clearAdd () {
      this.$confirm('确认清空所有内容吗,此操作将不可撤回!，是否继续？', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.addMember = {memGender: '男'}
        this.addMemTrend = {}
        this.addHistory = {}
        this.$message({
          type: 'success',
          message: '会员添加成功!'
        })
      }).catch(() => {
        this.$message('已取消添加')
      })
    }
  },
  created () {
    this.initMember()
  }
}
</script>
<style>

</style>
